Called on any server request.

<div class="definition">
    onRequest = function(event)
</div>

You can add event listener during the object creation:

<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    url        : 'some/url/to/data',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    onRequest: function(event) {
        console.log('-- server call --');
        console.log(event);
    }
});
</textarea>

or after the object has been created:

<textarea class="javascript">
w2ui.grid.on('request', function(event) {
    console.log('-- server call --');
    console.log(event);
});
</textarea>

One of the important features of this event is that you can change the data that will be sent to the server. When the event is
emitted, the <span class="argument">postData</span> property inside <span class="argument">event</span> object
will have all the variables to be sent to the server. If you modify <span class="argument">postData</span>, the grid will send
modified version to the server.
<br>
You can also change <span class="argument">url</span> property of <span class="argument">event</span> and the request will be sent to the new url.
<br>
You can also change <span class="argument">httpHeaders</span> property of <span class="argument">event</span> to change the AJAX headers of the request.
<div style="height: 10px;"></div>

The event handler is called before the default action of the event is triggered. You can cancel the default action by calling
<span class="method">event.preventDefault()</span>. To perform an action
after the event is fully processed, define <span class="method">event.onComplete</span> function.
<div style="height: 10px;"></div>
See <a href="utils/events">events</a> page in utilities for more details.
